package com.fly.feishu.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/error")
public class ErrorPageController {

    @GetMapping("/")
    public ModelAndView errorPage() {
        return new ModelAndView("error-500");
    }

    @GetMapping("message")
    public ModelAndView messagePage(String message) {
        ModelAndView modelAndView = new ModelAndView("error-message");
        modelAndView.addObject("message", message);
        return modelAndView;
    }
}
